// custom-tab-bar/index.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    // 当前默认第0个选中
    xfq: 0,
    // tab 的图片
    list: [{
      id: 0,
      path: "/pages/home/home",
      img: "/styte/icons/home.png",
      selectedIconPath: "/styte/icons/home-active.png"
    }, {
      id: 1,
      path: "/pages/movie/movie",
      img: "/styte/icons/movie.png",
      selectedIconPath: "/styte/icons/movie-active.png"
    }, {
      id: 2,
      path: "/pages/ticket/ticket",
      img: "/styte/icons/ticket-active.png",
      selectedIconPath: "/styte/icons/ticket-active.png"
    }, {
      id: 3,
      path: "/pages/cinema/cinema",
      img: "/styte/icons/cinema.png",
      selectedIconPath: "/styte/icons/cinema-active.png"
    }, {
      id: 4,
      path: "/pages/main/main",
      img: "/styte/icons/main.png",
      selectedIconPath: "/styte/icons/main-active.png"
    }]
  },

  /**
   * 组件的方法列表
   */
  methods: {
    goutap(e) {
      console.log(e);
      var path = e.currentTarget.dataset.path;
      wx.switchTab({
        url: path,
      });

    }
  }
})
